package com.zs.controller;

import com.zs.entity.Admin;
import com.zs.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    @RequestMapping("/adminLogin")
    public String adminLogin(Admin admin, HttpSession session) {
        Admin a = adminService.adminLogin(admin);
        session.setAttribute("admin", a);
        return "adminMain";

    }


}
